﻿using System;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Ymatou.CommonService;
using YmtRpc.Web.Admin.App_Start;

namespace YmtRpc.Web.Admin
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            //配置log4net
            log4net.Config.XmlConfigurator.Configure();

            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }

        public void Application_Error(object sender, EventArgs e)
        {
            Exception ex = Server.GetLastError();

            ApplicationLog.Error(string.Format("系统异常：{0}", ex.Message), ex);
        }
    }
}
